from pydantic import BaseModel, Field
from app.common.schema import RecodeMixinSchema


class UserOutSchema(BaseModel):
    id: int | None = Field(default=None, description="用户id")
    username: str = Field(description="用户名")
    password: str = Field(description="密码")

    class Config:
        pass
        from_attributes = True  # 读取python对象的属性，databases orm模型


class UserInSchema(BaseModel):
    username: str = Field(description="用户名")
    password: str = Field(description="密码")
    phone: str = Field(description="手机号")


class UserLoginSchema(BaseModel):
    username: str = Field(description="用户名")
    password: str = Field(description="密码")


class UserSearchSchema(BaseModel):

    username: str = Field(description="用户名")
